/* -----------------------------------------------------------------------
 * Chris Lewis
 * CS 362
 * Assignment 3: unittest1.c test of function getCost() in dominion.c
 *
 * unittest1: unittest1.c dominion.o rngs.o
 *      gcc -o unittest1 -g  unittest1.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>

//If NOISY is set to 0, then only an overall pass/fail will display.
//If NOISY is set to 1, then the cost of each card will be displayed.
#define NOISY 1

int main() {
        int cost;

    printf ("\n\n********* UNIT TEST 2 - getCost() ************\n");
        
        cost = getCost(curse);                                          //test cost of curse
        assert(cost == 0);
#if (NOISY == 1)
        printf("Cost of 'curse': %d\n", cost);
#endif

        cost = getCost(estate);                                         //test cost of estate 
        assert(cost == 2);
#if (NOISY == 1)
        printf("Cost of 'estate': %d\n", cost);
#endif

        cost = getCost(duchy);                                          //test cost of duchy 
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'duchy': %d\n", cost);
#endif

        cost = getCost(province);                                       //test cost of province
        assert(cost == 8);
#if (NOISY == 1)
        printf("Cost of 'province': %d\n", cost);
#endif

        cost = getCost(copper);                                         //test cost of copper 
        assert(cost == 0);
#if (NOISY == 1)
        printf("Cost of 'copper': %d\n", cost);
#endif

        cost = getCost(silver);                                         //test cost of silver
        assert(cost == 3);
#if (NOISY == 1)
        printf("Cost of 'silver': %d\n", cost);
#endif

        cost = getCost(gold);                                           //test cost of gold                     
        assert(cost == 6);
#if (NOISY == 1)
        printf("Cost of 'gold': %d\n", cost);
#endif

        cost = getCost(adventurer);                                     //test cost of adventurer
        assert(cost == 6);
#if (NOISY == 1)
        printf("Cost of 'adventurer': %d\n", cost);
#endif
        
        cost = getCost(council_room);                           //test cost of council_room
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'council_room': %d\n", cost);
#endif

        cost = getCost(feast);                                          //test cost of feast
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'feast': %d\n", cost);
#endif

        cost = getCost(gardens);                                        //test cost of gardens
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'gardens': %d\n", cost);
#endif

        cost = getCost(mine);                                           //test cost of mine
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'mine': %d\n", cost);
#endif

        cost = getCost(remodel);                                        //test cost of remodel
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'remodel': %d\n", cost);
#endif

        cost = getCost(smithy);                                         //test cost of smithy
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'smithy': %d\n", cost);
#endif

        cost = getCost(village);                                        //test cost of village
        assert(cost == 3);
#if (NOISY == 1)
        printf("Cost of 'village': %d\n", cost);
#endif

        cost = getCost(baron);                                          //test cost of baron
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'baron': %d\n", cost);
#endif

        cost = getCost(great_hall);                                     //test cost of great_hall
        assert(cost == 3);
#if (NOISY == 1)
        printf("Cost of 'great_hall': %d\n", cost);
#endif

        cost = getCost(minion);                                         //test cost of minion
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'minion': %d\n", cost);
#endif

        cost = getCost(steward);                                        //test cost of steward
        assert(cost == 3);
#if (NOISY == 1)
        printf("Cost of 'steward': %d\n", cost);
#endif

        cost = getCost(tribute);                                        //test cost of tribute
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'tribute': %d\n", cost);
#endif

        cost = getCost(ambassador);                                     //test cost of ambassador
        assert(cost == 3);
#if (NOISY == 1)
        printf("Cost of 'ambassador': %d\n", cost);
#endif

        cost = getCost(cutpurse);                                       //test cost of cutpurse
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'cutpurse': %d\n", cost);
#endif

        cost = getCost(embargo);                                        //test cost of embargo
        assert(cost == 2);
#if (NOISY == 1)
        printf("Cost of 'embargo': %d\n", cost);
#endif

        cost = getCost(outpost);                                        //test cost of outpost
        assert(cost == 5);
#if (NOISY == 1)
        printf("Cost of 'outpost': %d\n", cost);
#endif

        cost = getCost(salvager);                                       //test cost of salvager
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'salvager': %d\n", cost);
#endif

        cost = getCost(sea_hag);                                        //test cost of sea_hag
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'sea_hag': %d\n", cost);
#endif

        cost = getCost(treasure_map);                           //test cost of treasure_map
        assert(cost == 4);
#if (NOISY == 1)
        printf("Cost of 'treasure_map': %d\n", cost);
#endif


    printf("All tests passed!\n");

    return 0;
}